package Model;
import java.util.Date;

public class PeriodicTask extends Task 
{
	private String repeat;

    /**
     * Create a periodic task with the following parameters
     * @param iTaskName
     * @param iDueDatek
     * @param iType
     */
	public PeriodicTask(String iTaskName, Date iDueDatek, String iType)
	{
		super(iTaskName, iDueDatek, iType); 
	}

    /**
     * Create a periodic task with the following parameters
     * @param iTaskName
     * @param iDueDatek
     * @param iType
     * @param iPeriodFrequency
     */
	public PeriodicTask(String iTaskName, Date iDueDatek, String iType,String iPeriodFrequency)
	{
		super(iTaskName, iDueDatek, iType);
        setRepeat(iPeriodFrequency);
	}

    /**
     * Copy constructor
     * @param period
     */
    public PeriodicTask(PeriodicTask period){
        super(period.getName(), period.getDueDate(), period.getType());
    }

    /**
     * Set the repeat interval
     * @param repeat
     */
	public void setRepeat(String repeat)
	{
		this.repeat=repeat;
	}

    /**
     * Get the repeat interval
     * @return
     */
    public String getRepeat()
	{
		return this.repeat;
	}
	
    
    /**
     * Returns the due date for single tasks, 
     * Interval for periodic tasks
     * or "Complex" for complex tasks
     * @return
     */
    public String getDateString()
    {
    	return getRepeat();
    }

}
